﻿@model IEnumerable<MalkiSumWeb.Models.Language>
@{
    ViewBag.Title = "Language";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}

<h2>Language</h2>

@(Html.Telerik().Grid(Model)
        .Name("Grid")
        .ToolBar(commands => commands.Insert().ButtonType(GridButtonType.ImageAndText))
        .DataKeys(a=> a.Add(ac=> ac.ID))
        .Columns(columns =>
        {
            columns.Bound(o => o.NameAr);
            columns.Bound(o => o.NameEn);
            columns.Command(c => { c.Edit().ButtonType(GridButtonType.ImageAndText); c.Delete().ButtonType(GridButtonType.ImageAndText); });
        })
        .DataBinding(dataBinding => 
        {
            dataBinding.Ajax().Select("SelectLanguage", "Admin");
            dataBinding.Ajax().Insert("InsertLanguage", "Admin");
            dataBinding.Ajax().Update("UpdateLanguage", "Admin");
            dataBinding.Ajax().Delete("DeleteLanguage", "Admin");
        })
        .Sortable()
        .Pageable(paging => paging.PageSize(20))
        .Filterable()
)
